package com.flux.dispatcher


import io.reactivex.Observable
import io.reactivex.subjects.PublishSubject
import io.reactivex.subjects.Subject

/**
 * Rx version of an EventBus
 */
object RxBus {
    private val bus = PublishSubject.create<Any>().toSerialized()

    fun send(o: Any) {
        bus.onNext(o)
    }

    fun get(): Observable<Any> {
        return bus
    }
}